const {
	client
} = require('tencet')

exports.main = async (event, context) => {
	var char = event.char;
	var sessionId = event.sessionId;

	const params = {
		"Text": char,
		"SessionId": sessionId,
		"Codec": "mp3"
	};
	return new Promise((resolve, reject) => {
		client.TextToVoice(params).then(
			(data) => {
				resolve(data)
			},
			(err) => {
				reject(err)
			}
		);
	})
};